﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using 托尔斯泰.Wishire;
using 托尔斯泰.Wishire.entity;
using 托尔斯泰.Wishire.Operator;


/*传入Id，给方案*/

void test1()
{
    /*-------------- 计算初始化*/
    target_st target = new target_st();
    target.SetPlanId(0);
    target.SetTargetCity("武汉");
    target.SetTargetName("钟楼");

    opdatatarget op = new opdatatarget();
    List<target_st> ans = new List<target_st>();
    ans = op.targetFind_targetCity("武汉");
    List<target_st> tempp;
    
    //op.targetInsert(target);
    //var ans = op.targetFind(1);
    //Console.WriteLine(ans);
    /*foreach (var item in ans)
        Console.WriteLine(item);*/
    
}

//solve solve = new solve();
//solve.generate_swap(1, 2, 3);

solve solve = new solve();
var ans = solve.find_plan(1, "武汉");
Console.WriteLine(ans[0]);


/*
*经纬度更新
* 
* string SKey = "4738e58f8b2fef138445d4909f6ea60d"; //密钥
string ori = "116.481028,39.989643"; //起点：经纬度坐标
string des = "114.465302,40.004717"; //终点：经纬度坐标
Console.WriteLine("=======================");
Console.WriteLine("[" + ori + "]" + "===>" + "[" + des + "]");
Console.WriteLine("=======================");
string place = "黄鹤楼";
string dis_uri = $"https://restapi.amap.com/v3/place/text?keywords={place}&offset=1&page=1&key=a5942ceb738f4da4246a84497361fcff&extensions=base";
string distance = string.Empty;
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/xml;charset=UTF-8";
distance = wc.DownloadString(dis_uri);
}
for(int i=0; i<distance.Length; i++)
{

}
Console.WriteLine(distance);
Console.WriteLine("=======================");
Console.Write("\r\nPress any key to continue....");
Console.Read();*/